package org.davidtrevien.utils.date;

import javax.swing.JLabel;

public class JMonthLabel extends JLabel {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 2378098181123295369L;
	private int month;
	public static final int UNDEFINED = -1;

	public JMonthLabel() {
		super();
	}
	
	public JMonthLabel(int month) {
		super();
		setMonth(month);
	}
	
	public void setMonth(int m) {
		String text = "";
		this.month = m;
		switch (m) {
		case 1:
			text = "Janvier";
			break;
		case 2:
			text = "Février";
			break;
		case 3:
			text = "Mars";
			break;
		case 4:
			text = "Avril";
			break;
		case 5:
			text = "Mai";
			break;
		case 6:
			text = "Juin";
			break;
		case 7:
			text = "Juillet";
			break;
		case 8:
			text = "Août";
			break;
		case 9:
			text = "Septembre";
			break;
		case 10:
			text = "Octobre";
			break;
		case 11:
			text = "Novembre";
			break;
		case 12:
			text = "Décembre";
			break;

		default:
			text = "--";
			this.month = UNDEFINED;
			break;
		}
		
		setText(text);
	}
	
	public int getMonth() {
		return this.month;
	}
}
